<?php
defined( '_VALID_MOS' ) or die('<script>window.location.href="http://www.kinifurniture.com";</script>');


if(!$page_no)
	$page_no=1;
$MAX=$Small_box_end;
$MAX=9;
$lastrow=$MAX+$page_no;
if(!next_page)
	$next_page=1;
$next_page=$next_page+1;

$imgSr=$page_no;

$qry="select * from album order by id_album asc";
	$lim_min = ($page_no-1)*$MAX;
 
	$Qry="$qry limit $lim_min,$MAX"; 
	$sqlResult=$dbh->query($Qry);
		
	$total_row=$dbh->query($qry);
	$TOTAL_RECORDSET=mysql_num_rows($total_row);
		
$all_item_list='<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr><td>
	<table width="100%" border="0" cellspacing="3" cellpadding="0">
  <tr>';
  
  $i=0;	
 if($TOTAL_RECORDSET>0)
  { 	
while($sqlRow=@mysql_fetch_object($sqlResult))
{
$id_album=$sqlRow->id_album;
$nama_album=$sqlRow->nama_album;
$img_album=$sqlRow->img_album;
if ($img_album=='') $img_album='noimg.png';
		
if($i%3==0)
	{
       $all_item_list.='</tr>
</table>
</td>
  </tr>
  <tr><td height="5"></td></tr>
  <tr><td>
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>';

	}
		
$all_item_list.='<td>&nbsp;</td><td valign="top" width="167"><br/>
    <table width="100%" border="0" cellspacing="0" cellpadding="0" id="Gallery">
<tr>
    <td><div align="center"><a href="index.php?show=album&id='.$id_album.'"><img border="0" src="assets/album/'.$img_album.'" width="167" height="125" /></div></td>
  </tr>
    <tr>
    <td align="center"><br/>'.$nama_album.'<br/></td>
  </tr>
</table>
</td>
<td>&nbsp;</td>';
	
$i++;
		}
		
}
else
{
 $all_item_list.='<td align="center" class="headning_empty ">NO RECORD </td>';
}
	
	$all_item_list.='</tr>
</table>
</td>
  </tr></tr></table>';


//=====================Starting Pagination From Here==========================
	
	//global $my_page_name;
	$my_page_name="./index.php?show=gallery";
	include("pagination.inc");

//=====================Ending Pagination Here==========================	
?>